﻿using System;
using Windows.UI.Xaml.Data;

namespace Antares.Converters
{
    public class BoolToOpacityConverter : IValueConverter
    {
        public object Convert(object value, Type targetType, object parameter, string language)
        {
            if (value != null)
            {
                var b = (bool) value;
                return b ? 1 : 0.5;
            }

            return 1;
        }

        public object ConvertBack(object value, Type targetType, object parameter, string language)
        {
            throw new NotImplementedException();
        }
    }
}
